home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13557 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: SIN?
  5. Date: 8 Apr 1996 13:44:03 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4kbtqjINNpvs@keats.ugrad.cs.ubc.ca>
  8. References: <90.50656.1119@svis.org>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <90.50656.1119@svis.org>,
  12. Cory Pollock <cory.pollock@svis.org> wrote:
  13. >Hello All,
  14. >
  15. >Can someone please wirte a little program to show me what the function
  16. >SIN((FLOAT)X) does?
  17.  
  18. Conceptually, it constructs a circle of radius 1 centered on the origin of a
  19. cartesian coordinate system. It then draws a ray from the origin to the circle
  20. that is rotated X radians counterclockwise from the x axis. Then it measures
  21. the y coordinate of the point of intersection between the ray and the circle,
  22. and returns this value as a result.
  23.  
  24. The precision depends on having a high-resolution frame buffer with enough
  25. bit-depth to render the graphics with good anti-aliasing.
  26.  
  27. The sin() function in <math.h> does essentially the same thing but it takes
  28. advantage of mathematical theorems to effectuate a tremendous speedup.
  29. -- 
  30.  
  31.